/*
 * @Description: 字符数据注入（开发环境）
 * @Autor: HuiSir<273250950@qq.com>
 * @Date: 2024-02-06 14:49:11
 * @LastEditTime: 2024-09-03 22:39:08
 */
import { readFileSync } from "node:fs"
import getPosts from "./inc/getPosts.js"
import archivesByMonth from "./inc/archivesByMonth.js"
import archivesPostList from "./inc/archivesPostList.js"
import theContent from "./inc/theContent.js"
import { loading1, loading2 } from "./inc/loading.js"
import headerMenu from "./inc/headerMenu.js"
import footerMenu from "./inc/footerMenu.js"
import blogroll, { notice } from "./inc/blogroll.js"
import seo from "./inc/seo.js"
import articlePager from "./inc/articlePager.js"
import { devLinks as frontEndLinks } from "./inc/frontEndLinks.js"

export default {
  loading1,
  loading2,
  phpStart: "<!-- phpStart -->",
  phpEnd: "<!-- phpEnd -->",
  getThemeUriPath: ".",
  getHeader: readIncHtml("header.php"),
  getBlogName: "码农备忘录",
  getLogoLink: /* html */ `<a href="//127.0.0.1:8088/index.php" title="码农备忘录">码农备忘录</a>`,
  getPosts,
  getFooter: readIncHtml("footer.php"),
  getComments: readIncHtml("comments.php"),
  wpHead: "<!-- wpHead -->",
  wpFooter: "<!-- wpFooter -->",
  isArchive: "<!-- isArchive -->",
  isSingular: "<!-- isSingular -->",
  isSingularCss: "<!-- isSingular || is_404 || is_search -->",
  isSingle: "<!-- isSingle -->",
  isPage: "<!-- isPage -->",
  closeTag: "<!-- closeTag -->",
  archiveTitle: "归档示例标题",
  archiveDesc: /* html */ `<div class="active-description">这是示例描述，这是示例描述。</div>`,
  archivesByMonth,
  theTitle: "这是标题",
  theID: 838, // 页面ID-数字
  theTime: "2024-05-10",
  theContent,
  thePermalink: "#",
  tagsList: /* html */`<a>Doubt主题</a><a>END主题</a><a>wordpress</a>`,
  archivesPostList,
  postsWhile: "<!-- postsWhile -->",
  endwhile: "<!-- endwhile -->",
  endwhileElse: "<!-- endwhileElse -->",
  endif: "<!-- endif -->",
  ifHavePosts: "<!-- ifHavePosts -->",
  else: "<!-- else -->",
  postClassEntry: `class="page type-page status-publish"`,
  articleArchivesDesc: "<!-- 文章归档 -->",
  frontEndDesc: "<!-- 前端知识归纳 -->",
  accountStoreDesc: "<!-- 账号仓库 -->",
  getCustomViews: "199",
  editPostLink: /* html */ `<a class="post-edit-link" href="javascript:void(0);">[编辑]</a>`,
  theCategory: `<a>前端</a>, <a>开发</a>`,
  getContentTempPart: getPosts,
  getSearchParams: `示例搜索内容`,
  getHeaderMenuTempPart: headerMenu,
  getFooterMenuTempPart: footerMenu,
  getBlogroll: blogroll,
  getNotice: notice,
  getBeianLink: /* html */ `<a target="_blank" href="//www.miitbeian.gov.cn/">晋ICP备13002103号</a>&nbsp;·&nbsp;`,
  getMobileQrcodeLink: /* html */ `<img src="https://api.qrserver.com/v1/create-qr-code/?size=130x130&amp;data=#" alt="手机访问">`,
  setPageSeoInfo: seo,
  articlePager,
  postsCount: '100',
  commentsCount: '999',
  lastUpdateTime: '2024年8月2日',
  frontEndLinks,
  accountStoreVersion: '1.0.0',
  accountStoreDownload1: '#1',
  accountStoreDownload2: '#2',
  accountStoreDownload3: '#3',
  accountStorePic1: `#wp-content/uploads/2021/12/20211209135431.png`,
  accountStorePic2: `#wp-content/uploads/2021/12/20211209135857.png`,
  accountStorePic3: `#wp-content/uploads/2021/12/20211209140008.png`,
}

/**
 * 读取includes文件
 */
function readIncHtml (fileName) {
  return readFileSync(fileName).toString()
}
